package com.hui.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hui.entity.dao.ShopUser;
import com.hui.entity.dao.StoreOrder;
import com.hui.entity.vo.ComputeVo;
import com.hui.entity.vo.StoreOrderQueryVo;
import com.hui.entity.vo.UserOrderCountVo;
import com.hui.model.order.OrderParam;
import com.hui.util.ResponseResult;

import java.util.List;
import java.util.Map;

/**
 * 订单表(StoreOrder)表服务接口
 *
 * @author hui
 * @since 2022-07-21 00:12:56
 */
public interface StoreOrderService extends IService<StoreOrder> {

    /**
     * 准备创建订单
     *
     * @param shopUser
     * @param cartId
     * @return
     */
    ResponseResult confirmOrder(ShopUser shopUser, List<Integer> cartId);

    /**
     * 提交订单
     *
     * @param unique
     * @param uid
     * @return
     */
    StoreOrderQueryVo getOrderInfo(String unique, Long uid);

    /**
     * 创建订单
     *
     * @param shopUser
     * @param key
     * @param param
     * @return
     */
    StoreOrder createOrder(ShopUser shopUser, String key, OrderParam param);

    /**
     * 计算订单金额使用了
     *
     * @param userInfo
     * @param key
     * @param couponId
     * @param useIntegral
     * @param shippingType
     * @param addressId
     * @return
     */
    ComputeVo computedOrder(ShopUser userInfo, String key, String couponId, String useIntegral, String shippingType, String addressId);

    /**
     * 订单支付
     *
     * @param orderId
     * @param uid
     */
    void yuePay(String orderId, Long uid);

    /**
     * 订单列表
     *
     * @param uid
     * @param type
     * @param page
     * @param limit
     * @return
     */
    Map<String, Object> orderListByPage(Long uid, int type, int page, int limit);

    /**
     * 用于订单列表，不知到干啥
     *
     * @param order
     * @return
     */
    StoreOrderQueryVo handleOrder(StoreOrderQueryVo order);

    /**
     * 获取订单统计数据
     *
     * @param uid
     * @return
     */
    UserOrderCountVo orderData(Long uid);

    /**
     * 取消订单
     *
     * @param id
     * @param uid
     */
    void cancelOrder(String id, Long uid);

    /**
     * 订单删除
     *
     * @param uni
     * @param uid
     */
    void removeOrder(String uni, Long uid);
}

